3.182 \(\int \frac{1}{a+a \tan ^2(c+d x)} \, dx\)

Optimal. Leaf size=31 \[ \frac{\sin (c+d x) \cos (c+d x)}{2 a d}+\frac{x}{2 a} \]

[Out]

x/(2*a) + (Cos[c + d*x]*Sin[c + d*x])/(2*a*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0217207, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3657, 12, 2635, 8} \[ \frac{\sin (c+d x) \cos (c+d x)}{2 a d}+\frac{x}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Tan[c + d*x]^2)^(-1),x]

[Out]

x/(2*a) + (Cos[c + d*x]*Sin[c + d*x])/(2*a*d)

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{1}{a+a \tan ^2(c+d x)} \, dx &=\int \frac{\cos ^2(c+d x)}{a} \, dx\\ &=\frac{\int \cos ^2(c+d x) \, dx}{a}\\ &=\frac{\cos (c+d x) \sin (c+d x)}{2 a d}+\frac{\int 1 \, dx}{2 a}\\ &=\frac{x}{2 a}+\frac{\cos (c+d x) \sin (c+d x)}{2 a d}\\ \end{align*}

Mathematica [A]  time = 0.0259369, size = 26, normalized size = 0.84 \[ \frac{2 (c+d x)+\sin (2 (c+d x))}{4 a d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Tan[c + d*x]^2)^(-1),x]

[Out]

(2*(c + d*x) + Sin[2*(c + d*x)])/(4*a*d)

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 43, normalized size = 1.4 \begin{align*}{\frac{\tan \left ( dx+c \right ) }{2\,ad \left ( \left ( \tan \left ( dx+c \right ) \right ) ^{2}+1 \right ) }}+{\frac{\arctan \left ( \tan \left ( dx+c \right ) \right ) }{2\,ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+a*tan(d*x+c)^2),x)

[Out]

1/2/a/d*tan(d*x+c)/(tan(d*x+c)^2+1)+1/2/a/d*arctan(tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.54475, size = 49, normalized size = 1.58 \begin{align*} \frac{\frac{d x + c}{a} + \frac{\tan \left (d x + c\right )}{a \tan \left (d x + c\right )^{2} + a}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*((d*x + c)/a + tan(d*x + c)/(a*tan(d*x + c)^2 + a))/d

________________________________________________________________________________________

Fricas [A]  time = 1.02715, size = 100, normalized size = 3.23 \begin{align*} \frac{d x \tan \left (d x + c\right )^{2} + d x + \tan \left (d x + c\right )}{2 \,{\left (a d \tan \left (d x + c\right )^{2} + a d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*(d*x*tan(d*x + c)^2 + d*x + tan(d*x + c))/(a*d*tan(d*x + c)^2 + a*d)

________________________________________________________________________________________

Sympy [A]  time = 0.593096, size = 87, normalized size = 2.81 \begin{align*} \begin{cases} \frac{d x \tan ^{2}{\left (c + d x \right )}}{2 a d \tan ^{2}{\left (c + d x \right )} + 2 a d} + \frac{d x}{2 a d \tan ^{2}{\left (c + d x \right )} + 2 a d} + \frac{\tan{\left (c + d x \right )}}{2 a d \tan ^{2}{\left (c + d x \right )} + 2 a d} & \text{for}\: d \neq 0 \\\frac{x}{a \tan ^{2}{\left (c \right )} + a} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*tan(d*x+c)**2),x)

[Out]

Piecewise((d*x*tan(c + d*x)**2/(2*a*d*tan(c + d*x)**2 + 2*a*d) + d*x/(2*a*d*tan(c + d*x)**2 + 2*a*d) + tan(c +
 d*x)/(2*a*d*tan(c + d*x)**2 + 2*a*d), Ne(d, 0)), (x/(a*tan(c)**2 + a), True))

________________________________________________________________________________________

Giac [A]  time = 1.29782, size = 50, normalized size = 1.61 \begin{align*} \frac{\frac{d x + c}{a} + \frac{\tan \left (d x + c\right )}{{\left (\tan \left (d x + c\right )^{2} + 1\right )} a}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*((d*x + c)/a + tan(d*x + c)/((tan(d*x + c)^2 + 1)*a))/d